droptarget: Redo
authorBenjamin Otte <otte@redhat.com>
Sat, 29 Feb 2020 02:47:17 +0000 (03:47 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 2 Mar 2020 02:18:55 +0000 (03:18 +0100)
commita411959c910fbf86754b38ffcd7b9615d7788a74
tree86e43f40dc05fa41108d667dfbe5f82f3fb47c02
parentf4ac74795c41b2901b5b204aa76ec77010e59f95
droptarget: Redo

This is a huge reorganization of GtkDropTarget. I did not know how to
split this up, so it's unfortunately all one commit.

Highlights:

- Split GtkDropTarget into GtkDropTarget and GtkDropTargetAsync
  GtkDropTarget is the simple one that only works with GTypes and offers
  a synchronous interface.
  GtkDropTargetAsync retains the full old functionality and allows
  handling mime types.

- Drop events are handled differently
  Instead of picking a single drop target and sending all DND events to
  it, every event is sent to every drop target. The first one to handle
  the event gets to call gdk_drop_status(), further handlers do not
  interact with the GdkDrop.
  Of course, for the ultimate GDK_DROP_STARTING event, only the first
  one to accept the drop gets to handle it.
  This allows stacking DND event controllers that aren't necessarily
  interested in handling the event or that might decide later to drop
  it.

- Port all widgets to either of those
  Both have a somewhat changed API due to the new event handling.
  For the ones who should use the sync version, lots of cleanup was
  involved to operate on a sync API.
35 files changed:
demos/gtk-demo/clipboard.c
docs/reference/gtk/gtk4-sections.txt
gtk/gtk.h
gtk/gtkcalendar.c
gtk/gtkcolorbutton.c
gtk/gtkcolorswatch.c
gtk/gtkdragdest.c [deleted file]
gtk/gtkdragdest.h [deleted file]
gtk/gtkdrop.c [new file with mode: 0644]
gtk/gtkdropprivate.h [new file with mode: 0644]
gtk/gtkdroptarget.c [new file with mode: 0644]
gtk/gtkdroptarget.h [new file with mode: 0644]
gtk/gtkdroptargetasync.c [new file with mode: 0644]
gtk/gtkdroptargetasync.h [new file with mode: 0644]
gtk/gtkfilechooserbutton.c
gtk/gtkfilechooserwidget.c
gtk/gtkiconview.c
gtk/gtkiconviewprivate.h
gtk/gtklistbox.c
gtk/gtkmain.c
gtk/gtknotebook.c
gtk/gtkplacessidebar.c
gtk/gtktext.c
gtk/gtktextview.c
gtk/gtktreeview.c
gtk/gtkwidget.c
gtk/gtkwindow.c
gtk/meson.build
tests/testdnd.c
tests/testdnd2.c
tests/testdnd3.c
tests/testlist3.c
tests/testnotebookdnd.c
tests/testtreednd.c
testsuite/gtk/defaultvalue.c